package com.anlogic.sdk.utils.options;

import java.util.LinkedHashMap;
import java.util.Map;

public enum BitWidth {
	BIT64("64bit", "64-bit"), BIT32("32bit", "32-bit");
	
	private String id;
	
	private String name;

	private static Map<String, BitWidth> idMap = new LinkedHashMap<>();

	private static Map<String, BitWidth> nameMap = new LinkedHashMap<>();

	static {
		for (BitWidth value : BitWidth.values()) {
			idMap.put(value.getId(), value);
			nameMap.put(value.getName(), value);
		}
	}
	
	BitWidth(String id, String name) {
		this.id = id;
		this.name = name;
	}
	
	public String getId() {
		return this.id;
	}

	public String getName() {
		return this.name;
	}

	public static String[] getIds() {
		return idMap.keySet().toArray(new String[0]);
	}

	public static String[] getNames() {
		return nameMap.keySet().toArray(new String[0]);
	}

	public static BitWidth getTypeById(String id) {
		return idMap.get(id);
	}

	public static BitWidth getTypeByName(String name) {
		return nameMap.get(name);
	}
}
